/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package managedbean;

import ejb.common.MarchioManagerLocal;
import entity.Marchio;
import java.io.Serializable;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;

/**
 *
 * @author Valerio
 */
public class MarchiSelector implements Serializable{
    @EJB
    private MarchioManagerLocal marchioManager;
    
    private List<Marchio> marchi;
    private Marchio marchioSel;


    public List<Marchio> getMarchi() {
        return marchi;
    }

    public void setMarchi(List<Marchio> marchi) {
        this.marchi = marchi;
    }

    public Marchio getMarchioSel() {
        return marchioSel;
    }

    public void setMarchioSel(Marchio marchioSel) {
        Marchio eff=marchioManager.cercaPerId(marchioSel.getId());
        this.marchioSel = eff;
    }
    
    /**
     * Creates a new instance of MarchiSelector
     */
    public MarchiSelector() {
    }
    
    @PostConstruct
    public void init(){
        this.marchi=marchioManager.cercaTutto();
    }
}
